/**
 * 功能描述 回访记录
 */
define(function (require, exports, module) {
	var Grid = require("grid"); 	
	var aw = require("ajaxwrapper")
	var Dialog = require("dialog");
	var store =require("store");
	var activeUser = store.get("user");	
	
	var intentionRegisterGrid_Events = require("../handler/ReturnvisitGrid_Events");

    var instance = {
        initComponent: function (params, widget) {
        	var grid = new Grid({
                parentNode : ".J-recordgrid",
                model : {
                    columns : [{
                        name : "visitDate",
                        label : "访问时间",
                        format:"date",
						formatparams:{
					    	mode:"YYYY-MM-DD HH:mm"
					    }
                    },{
                        name : "productType.product.name",
                        label : "意向产品",
                    },{
                        name : "productType.name",
                        label : "产品类型",
                    },{
                        name : "intention.value",
                        label : "意向",
                    },{
                        name : "visitWay.name",
                        label : "访问方式",
                    },{
                        name : "recordType.value",
                        label : "访问类别",
                    },{
                        name : "customer.status.value",
                        label : "状态",
                    },{
                        name : "show",
                        label : "操作",
    					format:"button",
						formatparams:[{
							id:"edit",
							icon:"icon-edit",
							handler:function(index,data,rowEle){
								widget.set("edit", true);
								intentionRegisterGrid_Events.recordEdit(widget,data,false);
							}
						}]
                    }]
                }
            });
        	widget.set("recordgrid",grid);
        }
    };
    module.exports = instance;
});
